Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Filter Reports (index page) by status #112

Merged
merged 1 commit into from Dec 19, 2012
Merged

Conversation

gposton
Copy link
Contributor

@gposton gposton commented Aug 2, 2012

This pull request enables filtering of reports by the report's status.

The UI is modeled after the similar functionality for filtering nodes by 'last run' status (tabs for 'changed', 'changed', 'unchanged', 'failed', 'etc').

Value:
I've often found myself wanting the ability to quickly find the last updates applied to the environment. With our environment (that is fairly static most of the time), I spent quite a bit of time paging through unchanged reports before finding the last 'changed' report.

@ghost ghost self-assigned this Aug 23, 2012
@ccaum
Copy link
Contributor

ccaum commented Aug 23, 2012

This looks great. Thanks. Is there any way I can get you to write some rspec tests to ensure the tabs behave how they're supposed to?

@gposton
Copy link
Contributor Author

gposton commented Aug 24, 2012

Sure, I'll try to get to it early next week.

@gposton
Copy link
Contributor Author

gposton commented Aug 28, 2012

I get the following error when trying to run rake spec

/Users/gposton/src/puppet-dashboard/vendor/rails/activesupport/lib/active_support/test_case.rb:12: warning: already initialized constant Mocha
/Users/gposton/src/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:466:in `load_missing_constant': uninitialized constant Mocha::Standalone (NameError)
    from /Users/gposton/src/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:106:in `const_missing'
    from /Users/gposton/src/puppet-dashboard/vendor/gems/rspec-1.3.2/lib/spec/adapters/mock_frameworks/mocha.rb:12
    from /Users/gposton/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /Users/gposton/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /Users/gposton/src/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
    from /Users/gposton/src/puppet-dashboard/vendor/gems/rspec-1.3.2/lib/spec/runner/options.rb:313:in `plugin_mock_framework'
    from /Users/gposton/src/puppet-dashboard/vendor/gems/rspec-1.3.2/lib/spec/runner/options.rb:139:in `run_examples'
    from /Users/gposton/src/puppet-dashboard/vendor/gems/rspec-1.3.2/lib/spec/runner/command_line.rb:9:in `run'
    from /Users/gposton/src/puppet-dashboard/vendor/gems/rspec-1.3.2/bin/spec:5
rake aborted!

Are you familiar with this at all?

gposton:puppet-dashboard/ (master✗) $ gem list                                                                                                                                                                                                                       [16:03:23]

*** LOCAL GEMS ***

actionpack (3.2.8)
activemodel (3.2.8)
activesupport (3.2.8)
ap (0.1.1)
builder (3.0.0)
bundler (1.1.3)
colorize (0.5.8)
crack (0.3.1)
daemons (1.0.10)
diff-lcs (1.1.3)
domain_name (0.5.3)
erubis (2.7.0)
factory_girl (2.6.4)
ffi (1.0.11, 0.6.3)
haml (3.1.7)
hike (1.2.1)
httparty (0.8.3)
httpclient (2.2.5)
i18n (0.6.0)
journey (1.0.4)
json (1.7.1)
libvirt (0.2.0)
mail (2.4.4)
mechanize (2.4)
metaclass (0.0.1)
mime-types (1.18)
mocha (0.12.3)
mogilefs-client (3.1.1)
multi_json (1.3.4)
multi_xml (0.4.4)
mysql (2.8.1)
net-http-digest_auth (1.2)
net-http-persistent (2.6)
net-scp (1.0.4)
net-ssh (2.3.0)
nokogiri (1.4.7)
ntlm-http (0.1.1)
polyglot (0.3.3)
rack (1.1.2)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
rspec-mocks (2.11.2)
rspec-rails (2.11.0)
ruby-libvirt (0.3.0)
rubygems-bundler (0.9.0)
rvm (1.11.3.3)
sass (3.2.1)
soap4r (1.5.8)
sprockets (2.1.3)
sqlite3 (1.3.6)
sys-filesystem (1.0.0, 0.3.4)
terminal-table (1.4.5)
thor (0.16.0)
thoughtbot-shoulda (2.11.1)
tilt (1.3.3)
treetop (1.4.10)
typhoeus (0.3.3)
unf (0.0.5)
unf_ext (0.0.4)
webrobots (0.0.13)
will_paginate (3.0.3)
xml-simple (1.1.1)
gposton:puppet-dashboard/ (master✗) $ ruby -v                                                                                                                                                                                                                        [16:04:24]
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-darwin11.3.0]

@gposton
Copy link
Contributor Author

gposton commented Aug 28, 2012

I went ahead and committed some rspec's despite the fact that I can't figure out how to get spec to run. Perhaps someone would be willing to help me get rspec working (probably a gem version issue) or just checkout my spec's and let me know if they run successfully.

@sodabrew
Copy link
Owner

sodabrew commented Nov 7, 2012

@gposton
Copy link
Contributor Author

gposton commented Nov 19, 2012

Tests verified. Run the following to verify:

ruby script/spec spec/controllers/reports_controller_spec.rb

Note that the master branch currently contains 3 broken tests in this spec file. They are unrelated to my changes. All new tests related to my changes pass.

Sorry that I didn't have time to research and fix the broken ones.

@sodabrew
Copy link
Owner

I get these errors in the rails3 branch, which are the only ones I haven't figured out. Are they the same as you see on master (I've never gotten the tests running on master at all) -- they're in models/report, but I wonder if they underlie the controller errors.

  1) Report post transformer munging should idempotently update statuses and metrics
     Failure/Error: ]
       expected collection contained:  [["resources", "pending", 1], ["resources", "unchanged", 0]]
       actual collection contained:    [["resources", "pending", 1], ["resources", "pending", 1], ["resources", "unchanged", 0], ["resources", "unchanged", 0]]
       the extra elements were:        [["resources", "pending", 1], ["resources", "unchanged", 0]]
     # ./spec/models/report_spec.rb:101

  2) Report#create_from_yaml_file when create_from_yaml fails not unlink the file if create_from_yaml fails
     Failure/Error: Report.expects(:create_from_yaml).raises(ActiveRecord::StatementInvalid)
     Mocha::ExpectationError:
       not all expectations were satisfied
       unsatisfied expectations:
       - expected exactly once, invoked 3 times: Report(id: integer, node_id: integer, host: string, time: datetime, status: string, kind: string, puppet_version: string, configuration_version: string).create_from_yaml(any_parameters)
       satisfied expectations:
       - expected never, not yet invoked: File.unlink('/tmp/foo')
       - expected at least once, invoked 3 times: File.read('/tmp/foo')
     # ./spec/models/report_spec.rb:426

@gposton
Copy link
Contributor Author

gposton commented Nov 19, 2012

Doesn't look like the same ones. Here are the ones I get from master branch.

I openly admit that these failures may also be related to an issue with my gem versions.

Just curious, is bundler being used in the Rails 3 branch?

1)
NameError in 'ReportsController#create should fail with a 403 error when disable_legacy_report_upload_url is true'
uninitialized constant Mocha::Mockery::ImpersonatingName
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/mockery.rb:34:in `mock_impersonating'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:16:in `mocha'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:99:in `stubs'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `call'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `each'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:94:in `stubs'
./spec/controllers/reports_controller_spec.rb:81:
script/spec:10:

2)
NameError in 'ReportsController#create should succeed when disable_legacy_report_upload_url is false'
uninitialized constant Mocha::Mockery::ImpersonatingName
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/mockery.rb:34:in `mock_impersonating'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:16:in `mocha'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:99:in `stubs'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `call'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `each'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:94:in `stubs'
./spec/controllers/reports_controller_spec.rb:87:
script/spec:10:

3)
NameError in 'ReportsController without JSON pagination GET index as HTML will paginate'
uninitialized constant Mocha::Mockery::ImpersonatingName
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/mockery.rb:34:in `mock_impersonating'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:16:in `mocha'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:99:in `stubs'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `call'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `each'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:94:in `stubs'
/Users/gposton/src/puppet-dashboard/spec/shared_behaviors/controller_mixins.rb:55:
script/spec:10:

Finished in 3.211978 seconds

27 examples, 3 failures

@sodabrew
Copy link
Owner

Oh, gotcha. In spec/spec_helper.rb I switched require 'mocha' to require 'mocha_standalone' -- however this may also be due to using a newer Mocha (0.12.x).

@gposton
Copy link
Contributor Author

gposton commented Nov 19, 2012

I made the change you requested and still get the same errors.

gposton:puppet-dashboard/ (master✗) $ ruby script/spec spec/controllers/reports_controller_spec.rb                                                                       [15:27:42]
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Users/gposton/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:104.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:104.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:104.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:104.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from /Users/gposton/src/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
/Users/gposton/src/puppet-dashboard/vendor/rails/activesupport/lib/active_support/test_case.rb:12: warning: already initialized constant Mocha

ReportsController#search when searching for files when nothing is specified
- should not perform a search, and should add error messages

ReportsController#search when searching for files when the page first loads
- should not perform a search, and should not add error messages

ReportsController#search when searching for files when only file content is specified
- should not perform a search, and should add an error message

ReportsController#search when searching for files when both file title and content are specified
- should return both matching and unmatching nodes

ReportsController#search
- should render the search form if there are no parameters

ReportsController#unchanged
- should render the index template and show only unchanged reports

ReportsController#changed
- should render the index template and show only changed reports

ReportsController#pending
- should render the index template and show only pending reports

ReportsController#failed
- should render the index template and show only failed reports

ReportsController#all
- should render the index template and show all reports

ReportsController#index
- should render the index template and show all reports

ReportsController#create
- should fail with a 403 error when disable_legacy_report_upload_url is true (FAILED - 1)
- should succeed when disable_legacy_report_upload_url is false (FAILED - 2)

ReportsController#upload with a POST with invalid report data, the response code
- should be 200, because we queued the job

ReportsController#upload with a POST without a report, the response code
- should be 200, because we queued the job

ReportsController#upload with a POST with a report inside the report parameter
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0297
- should not raise Exception
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0268
- should change #count
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0362
- should change #result

ReportsController#upload with a POST from Puppet 0.25.x
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0291
- should not raise Exception
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0741
- should change #count
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0750
- should change #result

ReportsController#upload with a POST from Puppet 2.6.x
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0739
- should not raise Exception
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0755
- should change #count
[Worker(host:Glenn-Postons-MacBook-Pro.local pid:36111)] Report.create_from_yaml_file completed after 0.0794
- should change #result

ReportsController without JSON pagination GET index as YAML
- does not paginate

ReportsController without JSON pagination GET index as JSON
- does not paginate

ReportsController without JSON pagination GET index as HTML
- will paginate (FAILED - 3)

1)
NameError in 'ReportsController#create should fail with a 403 error when disable_legacy_report_upload_url is true'
uninitialized constant Mocha::Mockery::ImpersonatingName
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/mockery.rb:34:in `mock_impersonating'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:16:in `mocha'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:99:in `stubs'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `call'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `each'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:94:in `stubs'
./spec/controllers/reports_controller_spec.rb:81:
script/spec:10:

2)
NameError in 'ReportsController#create should succeed when disable_legacy_report_upload_url is false'
uninitialized constant Mocha::Mockery::ImpersonatingName
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/mockery.rb:34:in `mock_impersonating'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:16:in `mocha'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:99:in `stubs'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `call'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `each'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:94:in `stubs'
./spec/controllers/reports_controller_spec.rb:87:
script/spec:10:

3)
NameError in 'ReportsController without JSON pagination GET index as HTML will paginate'
uninitialized constant Mocha::Mockery::ImpersonatingName
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/mockery.rb:34:in `mock_impersonating'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:16:in `mocha'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:99:in `stubs'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `call'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/argument_iterator.rb:15:in `each'
/Users/gposton/src/puppet-dashboard/vendor/gems/mocha-0.9.7/lib/mocha/object.rb:94:in `stubs'
/Users/gposton/src/puppet-dashboard/spec/shared_behaviors/controller_mixins.rb:55:
script/spec:10:

Finished in 2.551086 seconds

27 examples, 3 failures
gposton:puppet-dashboard/ (master✗) $ git diff                                                                                                                           [15:27:57]
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 09965ad..cc83874 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -4,7 +4,7 @@ $LOAD_PATH.push File.dirname(__FILE__)
 # from the project root directory.
 ENV["RAILS_ENV"] = "test"
 require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
-require 'mocha'
+require 'mocha_standalone'
 require 'spec/autorun'
 require 'spec/rails'
 require 'shoulda'
gposton:puppet-dashboard/ (master✗) $ gem list | grep mocha                                                                                                              [15:28:02]
mocha (0.12.3)

@sodabrew
Copy link
Owner

I just found on Mocha's website:

Versions 0.10.2, 0.10.3 & 0.11.0 of the gem were broken.
Versions 0.9.6 & 0.9.7 of the Rails plugin were broken.
Please do not use these versions.

@gposton
Copy link
Contributor Author

gposton commented Dec 11, 2012

I believe that this is ready to merge. The tests related to my code is passing. There are some failures, but they're not related to the code I wrote.

Notes: I'm using mocha v0.12.3 and rails v3.2.8

@sodabrew
Copy link
Owner

@gposton Could you rebase your branch to current master, and squash a single commit?

@gposton
Copy link
Contributor Author

gposton commented Dec 18, 2012

First time I've done a rebase as opposed to merging. I love git more and more everyday.

Rebase and squash complete.

@sodabrew
Copy link
Owner

Nice! I think the only change to complain about is mocha vs. mocha_standalone in spec/spec_helpers. I'll try to test this change out in the next few days, but from a code perspective I like it.

Not required, but to help showcase the change, could you post 1-2 cropped screenshots of the new tabs and screens?

@gposton
Copy link
Contributor Author

gposton commented Dec 18, 2012

Screen Shot 2012-12-18 at 4 50 19 PM
Screen Shot 2012-12-18 at 4 50 58 PM
Screen Shot 2012-12-18 at 4 52 59 PM

@sodabrew
Copy link
Owner

Totally awesome. I'm all for this. @puppetlabs opinion?

@lifton
Copy link
Contributor

lifton commented Dec 19, 2012

I'm also not sure about the mocha versus mocha_standalone, but if it works, then go for it. This is a great feature to add. @sodabrew, merge away if you're comfortable with it. @gposton, thanks for the contribution!

@sodabrew
Copy link
Owner

@gposton please change the spec/spec_helper mocha_standalone back to plain mocha -- for version 0.9.7 that's bundled locally in the PD repo plain 'mocha' appears to be preferred. Squash the change in and I'll merge asap.

- supporting named_scopes in report model
- supporting routes
- supporting controller actions
@gposton
Copy link
Contributor Author

gposton commented Dec 19, 2012

@sodabrew mocha_standalone has been reverted back to mocha as requested

sodabrew added a commit that referenced this pull request Dec 19, 2012
Filter Reports (index page) by status
@sodabrew sodabrew merged commit b980f95 into sodabrew:master Dec 19, 2012
@haus
Copy link
Contributor

haus commented Dec 19, 2012

@sodabrew @gposton I've put a pull in to revert this. As mentioned in that pull, a migration uses the reports model to make the migration, so when the report model changes, that migration breaks.

There are two basic solutions to this that I see:

a.) update the old migration to not use the model

b.) update the report changes to use a second table that is then joined against the reports

Without a, the reports model can never change, so it is probably the better of the two solutions, even though I hate the idea of editing old migrations.

adaburrows added a commit that referenced this pull request Dec 19, 2012
Revert "Merge pull request #112 from gposton/master"
@sodabrew
Copy link
Owner

@gposton Please resubmit with this scope removed -- overriding Report.all is apparently bad news.

  named_scope :all, :conditions => {:kind => "apply"}, :include => :metrics

@gposton gposton mentioned this pull request Dec 20, 2012
@sodabrew
Copy link
Owner

sodabrew commented Jan 2, 2013

For posterity, the Gem errors above were caused by a too-new version of Rubygems. Turns out that Dashboard requires version 1.3.x, begins warning on higher versions, and begins failing somewhere around version 1.8.x.

@sodabrew sodabrew mentioned this pull request Apr 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants